using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using System.Net;

namespace WisdriContactsAndroid
{
	[Activity (Label = "Wisdri通讯簿", MainLauncher = true)]
	public class MainActivity : TabActivity
	{
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			// Set our view from the "main" layout resource
			SetContentView (Resource.Layout.Main);

			TabHost.TabSpec spec;     // Resusable TabSpec for each tab     
			Intent intent;            // Reusable Intent for each tab     
			// Create an Intent to launch an Activity for the tab (to be reused)     
			intent = new Intent (this, typeof(Department));  
			intent.AddFlags (ActivityFlags.NewTask);  
			// Initialize a TabSpec for each tab and add it to the TabHost     
			spec = TabHost.NewTabSpec ("tab1");  
			spec.SetIndicator ("部门", Resources.GetDrawable (Android.Resource.Drawable.IcMenuToday));  
			spec.SetContent (intent);  
			TabHost.AddTab (spec);  

			// Do the same for the other tabs     
			intent = new Intent (this, typeof(Search));  
			intent.AddFlags (ActivityFlags.NewTask);  
			spec = TabHost.NewTabSpec ("tab2");  
			spec.SetIndicator ("查询", Resources.GetDrawable (Android.Resource.Drawable.IcMenuSearch));  
			spec.SetContent (intent); 
			TabHost.AddTab (spec);
			  
			intent = new Intent (this, typeof(About));  
			intent.AddFlags (ActivityFlags.NewTask);  
			spec = TabHost.NewTabSpec ("tab3");  
			spec.SetIndicator ("关于", Resources.GetDrawable (Android.Resource.Drawable.IcMenuInfoDetails));  
			spec.SetContent (intent);  
			TabHost.AddTab (spec);  

			intent = new Intent (this, typeof(Update));  
			intent.AddFlags (ActivityFlags.NewTask);  
			spec = TabHost.NewTabSpec ("tab4");  
			spec.SetIndicator ("更新", Resources.GetDrawable (Android.Resource.Drawable.IcMenuRotate));  
			spec.SetContent (intent);  
			TabHost.AddTab (spec);

            intent = new Intent(this, typeof(Active));
            intent.AddFlags(ActivityFlags.NewTask);
            spec = TabHost.NewTabSpec("tab5");
            spec.SetIndicator("激活", Resources.GetDrawable(Android.Resource.Drawable.IcMenuHelp));
            spec.SetContent(intent);
            TabHost.AddTab(spec);  

//			TabHost.CurrentTab = 0;  
		}
	}
}


